Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate the discover step documentation #3311

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mcasquer
Copy link
Collaborator

@mcasquer mcasquer commented Oct 23, 2024

Currently, the documentation about discover is duplicated in someway between the specification and the plugin section. Adds the missing information into the plugin section as it will be the primary source.

Pull Request Checklist

  • write the documentation
  • update the specification
  • adjust plugin docstring
  • include a release note

@mcasquer
Copy link
Collaborator Author

@psss I am not sure about deleting also the follwoing lines

It is also possible to limit tests only to those that have changed
in git since a given revision. This can be particularly useful when
testing changes to tests themselves (e.g. in a pull request CI).
Related config options (all optional):
* ``modified-only`` - set to ``true`` if you want to filter modified tests
* ``modified-url`` - fetched as "reference" remote in the test dir
* ``modified-ref`` - the ref to compare against

The configs are explained in the inherited configuration

@mcasquer mcasquer force-pushed the discover_deduplication branch from 1de4920 to f467ba5 Compare October 23, 2024 10:41
@mcasquer
Copy link
Collaborator Author

Also @psss should I include the removal of the no longer needed information from the specs in this PR?

@mcasquer mcasquer marked this pull request as ready for review November 11, 2024 08:51
@mcasquer mcasquer force-pushed the discover_deduplication branch from f467ba5 to 137f23f Compare January 20, 2025 13:23
@mcasquer mcasquer requested a review from martinhoyer as a code owner January 20, 2025 13:23
@mcasquer mcasquer force-pushed the discover_deduplication branch 6 times, most recently from 6fcb18e to 443cc56 Compare January 27, 2025 14:03
@happz happz added this to the 1.43 milestone Jan 30, 2025
@happz happz added the documentation Improvements or additions to documentation label Jan 30, 2025
Copy link
Collaborator

@therazix therazix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple formatting suggestions.

tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
@mcasquer mcasquer force-pushed the discover_deduplication branch from 1dd0e5a to c71fac2 Compare February 4, 2025 22:38
@mcasquer
Copy link
Collaborator Author

mcasquer commented Feb 5, 2025

Hello, how can I fix the CI pathspec issue?
error: pathspec '1.42.0' did not match any file(s) known to git

@happz
Copy link
Collaborator

happz commented Feb 5, 2025

Hello, how can I fix the CI pathspec issue? error: pathspec '1.42.0' did not match any file(s) known to git

Hopefully soon to be fixed by #3507

tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/shell.py Outdated Show resolved Hide resolved
tmt/steps/discover/shell.py Outdated Show resolved Hide resolved
@mcasquer mcasquer force-pushed the discover_deduplication branch 2 times, most recently from 3d0b208 to 00ed836 Compare February 11, 2025 07:36
@mcasquer mcasquer force-pushed the discover_deduplication branch from ce2da59 to 0ad1f54 Compare February 12, 2025 13:40
@mcasquer
Copy link
Collaborator Author

For some reason with the current patch the following command is not working:

(dev) [mcasquer@fedora tmt]$ tmt run discover --how fmf --help
Unhandled ReST node '<emphasis>default</emphasis>'.

It's likely related with the deletion in the discover.fmf but after restoring the file I don't see it works...

@happz
Copy link
Collaborator

happz commented Feb 12, 2025

For some reason with the current patch the following command is not working:

(dev) [mcasquer@fedora tmt]$ tmt run discover --how fmf --help
Unhandled ReST node '<emphasis>default</emphasis>'.

It's likely related with the deletion in the discover.fmf but after restoring the file I don't see it works...

Removed file is not causing this, it's about what was added to discover/fmf plugin:

            Additionally, one can set ``ref`` dynamically.
            This is possible using a special file in tmt format
            stored in the *default* branch of a tests repository.
            This special file should contain rules assigning attribute ``ref``
            in an `adjust` block, for example depending on a test run context.

The *default* is the emphasis tmt does not know how to render for CLI.

If you add the following bit to your code, does it work?

diff --git a/tmt/utils/rest.py b/tmt/utils/rest.py
index c7f4a613..2ee4431c 100644
--- a/tmt/utils/rest.py
+++ b/tmt/utils/rest.py
@@ -201,6 +201,13 @@ class RestVisitor(docutils.nodes.NodeVisitor):
 
     depart_literal = _noop_departure
 
+    def visit_emphasis(self, node: docutils.nodes.literal) -> None:
+        self.log_visit(str(node))
+
+        self._emit(click.style(node.astext(), fg='yellow'))
+
+    depart_emphasis = _noop_departure
+
     def visit_literal_block(self, node: docutils.nodes.literal_block) -> None:
         self.log_visit(str(node))

@mcasquer
Copy link
Collaborator Author

The *default* is the emphasis tmt does not know how to render for CLI.

If you add the following bit to your code, does it work?

@happz thanks for the quick reply, that makes sense.
Yeah it works ! I only need to change `adjust` to *adjust* 😀

@mcasquer mcasquer force-pushed the discover_deduplication branch from 32940c5 to e4b0e14 Compare February 14, 2025 06:35
@mcasquer
Copy link
Collaborator Author

@psss any more thoughts on this PR?

Copy link
Collaborator

@therazix therazix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of suggestions.

tmt/steps/discover/fmf.py Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Outdated Show resolved Hide resolved
tmt/steps/discover/shell.py Outdated Show resolved Hide resolved
tmt/steps/discover/shell.py Outdated Show resolved Hide resolved
tmt/steps/discover/fmf.py Show resolved Hide resolved
spec/plans/discover.fmf Outdated Show resolved Hide resolved
@mcasquer mcasquer force-pushed the discover_deduplication branch 2 times, most recently from 6fa6573 to cf0f02a Compare February 17, 2025 21:11
Currently, the documentation about discover is duplicated
in someway between the specification and the plugin section.
Adds the missing information into the plugin section as it
will be the primary source.

Signed-off-by: mcasquer <[email protected]>
Updates the modified tests behavior configs putting
more information and adds all the parameters supported.

Signed-off-by: mcasquer <[email protected]>
Signed-off-by: mcasquer <[email protected]>
Signed-off-by: mcasquer <[email protected]>
Also adds some missing information for dis git configs.

Signed-off-by: mcasquer <[email protected]>
Also updates the adjust litearal to be compatible with this function.

Signed-off-by: mcasquer <[email protected]>
@mcasquer mcasquer force-pushed the discover_deduplication branch from cf0f02a to 0fdf55f Compare February 18, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants